package com.mini.rpc.register;

/**
  * @description TODO
  * @author lbx
  * @date 2021/10/5 10:12
  * @version 1.0.0
 **/
public class RegistryFactory {

    private static volatile RegistryService registryService;

    public static RegistryService getInstance(String registryAddr,RegistryType registryType) throws Exception{
        if(registryService == null){
            synchronized (RegistryFactory.class){
                if(registryService == null){
                    switch (registryType){
                        case NACOS:
                            break;
                        case EUREKA:
                            break;
                        case ZOOKEEPER:
                            registryService = new ZookeeperRegistryService(registryAddr);
                            break;
                    }
                }
            }
        }
        return registryService;
    }
}
